#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>

int main()
{
	int N = 0;
	int arr[50] = { 0 };
	int discard = 0;
	int i = 0;

	scanf("%d", &N);
	for (i = 0; i < N; i++)
	{
		scanf("%d", &arr[i]);
	}
	scanf("%d", &discard);

	for (i = 0; i < N; i++)
	{
		if (arr[i] != discard)
		{
			printf("%d ", arr[i]);
		}
	}

	return 0;
}